package com.cetcs.kmga.log.oper;

import com.cetcs.kmga.log.service.LogService;
import com.cetcs.kmga.log.util.MySQLClient;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * 数据操作控制层
 *
 * @author xutao
 * @version V1.0 创建时间：2017-09-14 15:31
 *          Copyright 2017 by CETC
 */
public class LogOper {


    /**
     * 创建表信息
     */
    @Test
    public void testCreateTb() {
        LogService logService = new LogService( );

        String[] leftName = {"Hbase访问日志", "Solr访问日志", "MySQL访问日志", "MongoDB访问日志", "FTP采集日志", "数据库静态脱敏 - Hbase",
                "数据库静态脱敏 - Solr", "数据库静态脱敏 - MySql", "数据库动态脱敏 - MySql", "文件静态脱敏", "文件动态脱敏",
                "运维操作日志",
                "监管平台日志", "探针设备日志", "脱敏设备日志", "运维设备日志"};
        String[] enName = {"HbaseFWRZ", "SolrFWRZ", "MySQLFWRZ", "MongoDBFWRZ", "FTPCJRZ",
                "JTTMHbase", "JTTMSolr", "JTTMMySql", "DTTMMySql", "WJJTTM", "WJDTTM",
                "YWCZRZ",
                "JGPTRZ", "TZSBRZ", "TMSBRZ", "YWSBRZ"};
        for (int i = 0; i < leftName.length; i++) {
            logService.importLogTb("ODS_SDP_MZGA_BUSI_POP_COMMON_FEATURE", enName[i], leftName[i], "ID", "30", "0", null, "MZGA");
        }
    }

    /**
     * 导入表的字段
     *
     * @throws Exception
     */
    @Test
    public void testCreateTbField() throws Exception {

        LogService logService = new LogService( );
        logService.importTbLogField( );
    }

    /**
     * 导入查询条件
     *
     * @throws Exception
     */
    @Test
    public void importLogQueryField() throws Exception {

        LogService logService = new LogService( );
        logService.importLogQueryField( );
    }


    @Test
    public void testEnum() {
        String HbaseFWRZ = ResLogTypeEnum.HbaseFWRZ.toString( );

        System.out.println(ResLogTypeEnum.valueOf(HbaseFWRZ).getValue( ));
    }

}
